import {connect} from "react-redux";
import { addParkinglots } from "../actions/home";
import ParkLots from "../components/Home/Parklots/index";
import {getAllParkLots} from "../apis/parkLotApi";

const mapStateToProps = (state) => ({
    parklots: state.parklotsReducer
});
const mapDispatchToProps = (dispacth) => ({
    findAllParklots: async () => {
        const data = await getAllParkLots();
        dispacth(addParkinglots(data));
    }
});
const ParkLotsContainer = connect(mapStateToProps, mapDispatchToProps)(ParkLots);

export default ParkLotsContainer;